<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>正向开发报表</title>
<script type="text/javascript">
	function submitOrderBatch() {
		$('#flagtype').val(1);
		$("#search").submit();
		$('#flagtype').val(0);
	}
</script>
<body class="withvernav">
<div class="bodywrapper">
	{{include file='/public/leftmenu.tpl'}}
	<div class="centercontent tables">
		<div class="pageheader notab">
			<h1 class="pagetitle">正向开发报表</h1>

  <span class="pagedesc">
	  <!--
	  1、卖出第一件起,上架30天内10件300,20件600,30件900 <br>&nbsp;&nbsp;&nbsp;&nbsp;
	  2、卖出第一件起,上架90天内30件300,60件600,90件900<br>&nbsp;&nbsp;&nbsp;&nbsp;
	  3、上述所指1、2不累加计算
	  -->
  </span>
			<div class="menulist">
				<ul class="profile_summary">
					<!--
					<li class="current"> <a href="/datareport/externalBuy_refund" target="_blank"><span>退款列表</span></a></li>
					<li class="current"> <a href="/datareport/ajaxbutton?op=historyList" target="_blank"><span>已结算列表</span></a></li>
					-->
				</ul>
			</div>
		</div>
		<!--pageheader-->
		<div>
			<div style="float:left">
				{{if $managers || in_array('263',$showpower)}}  &nbsp;&nbsp;
					<a href="javascript:void(0)" onClick="MergeProduct()" class="btn btn2 btn_help"><span>结算</span></a>
				{{/if}}
				{{if $managers || $userdepartment == 2}}
				<button type="button" class="btn btn-primary "  onclick="submitOrderBatch(2)">导出excel</button>
				{{/if}}
			</div>
			<div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
		</div>
		<div id="contentwrapper" class="contentwrapper">
			<!--搜索栏-->
			<form class="stdform stdform2" method="get" action="/datareport/newproduct" id="search">
				<div class="tableoptions">
					结束时间
					<input type="text"  name="starttime" id="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" id="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
					开发者:
					<select name="developer" id="developer" class="selection select2_group" style="width:100px;" >
						<option value="0">请选择</option>
						{{foreach from=$userlist item=res key=key}}
						<option value="{{$res}}" {{if $developer eq $res}} selected{{/if}}>{{$res}}</option>
						{{/foreach}}
					</select>
					&nbsp;
					商品编号: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
					&nbsp;
					是否结算:
					<select name="jiesuan" id="jiesuan" class="selection select2_group" style="width:100px;" >
						<option value="0">请选择</option>
						<option value="1" {{if $jiesuan eq 1}} selected{{/if}}>已结算</option>
						<option value="2" {{if $jiesuan eq 2}} selected{{/if}}>未结算</option>
					</select>
					<input type="hidden" id="flagtype" name="flagtype" value="">
					<button class="btn btn_orange btn_search radius50">Search</button>
					&nbsp;{{if $total_money}}<span style="color:red">合计未结算总额：{{$total_money}}</span>{{/if}}
					<span id="allcount"></span>
				</div>
			</form>
			<!--搜索栏结束-->

			<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
				<colgroup>
					<col class="con1" />
					<col class="con0" />
					<col class="con1" />
					<col class="con0" />
					<col class="con1" />
					<col class="con0" />
					<col class="con1" />
				</colgroup>
				<thead>
				<tr>
				  <th class="head0"><a onclick="allSelect('ppid[]')">全选</a></th>
					
				  <!--
					<th class="head0"><a onClick="allSelect('ppid[]')">全选</a></td>
					-->
					<th class="head0">商品编号</th>
					<th class="head1" style="width:500px;">商品名称</th>
					<th class="head0">上架时间</th>
					<th class="head0">结束时间</th>
					<th class="head1">30天销量(连续) </th>
					<th class="head0">90天销量</th>
					<th class="head0">开发者</th>
					<th class="head0">结算时间</th>
					<th class="head0">结算金额</th>
					<th class="head0">操作</th>
				</tr>
				</thead>
				<tbody>
				{{foreach from=$list item=li key=key}}
				<tr>
				  <td><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}"></td>
					
				  <!--
					<td >
						<input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}" />
					</td>
					-->
					<td><a href="/product/newproduct?other={{$li.sku}}" target="_blank">{{$li.sku}}</a>
					</td>
					<td>{{$li.name}}</td>
					<td>{{$li.startdate}}</td>
					<td class="center">{{$li.enddate}}</td>
					<td class="center">{{$li.nums_30day}}</td>
					<td class="center">{{$li.nums_90day}}</td>
					<td class="center">{{$li.createName}}</td>
					<td class="center">{{if $li.cutoff_time}}{{$li.cutoff_time}}{{else}}未结算{{/if}}</td>
					<td class="center">{{$li.cutoff_money}}</td>
					<td class="center">
						<a href="/datareport/ajaxbutton?op=newproductList&sku={{$li.sku}}" target="_blank">查看详细</a>
					</td>
				</tr>
				{{/foreach}}
			                 
			    </tbody>

			</table>
			<div class="page">{{$pageList}}</div>
			<br />
			<br />
		</div>
	</div>
	<!--bodywrapper-->
	<script language="javascript">
		function MergeProduct()
		{
			var str = selectallpro();
			if(str ==false)
			{
				return;
			}else{
				$("#productid").val(str);
			}
			$('#MergeProductform').modal('show');
		}
	</script>
	<!-- 模态框（Modal） 结算-->
	<form action="/datareport/ajaxbutton?op=savenewProductDate"  method="post" name="uctform" id="uctform" >
		<div class="modal fade" id="MergeProductform" tabindex="-1" role="dialog" aria-labelledby="sMergeProductform" aria-hidden="true">
			<div class="modal-dialog" style="width:740px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
						        aria-hidden="true">× </button>
						<h4 class="modal-title" id="sMergeProductform">结算 </h4>
					</div>
					<div class="modal-body">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>结算时间&nbsp;&nbsp;&nbsp;<input type="text"  name="cutofftime" id="cutofftime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
								</td>
							</tr>
							<tr>
								<td>
									开发者:
									<select name="kaideveloper" id="kaideveloper"  style="width:100px;" >
										<option value="0">所有人</option>
										{{foreach from=$userlist item=res key=key}}
										<option value="{{$res}}" {{if $developer eq $res}} selected{{/if}}>{{$res}}</option>
										{{/foreach}}
									</select>
								</td>
							</tr>
							<!--
							<tr>
								<td style="line-height:25px;">关于结算说明：<br>
									1、新的商品未进行结算，结算时间以上架时间为准<br>
									2、当商品销售1个月或2个月，需要进行结算时，输入当前结算时间，
									输入的时间为下个周期结算时间起始点<br>
									3、保存结算时间后，商品提成统计自动进入下个周期<br>

								</td>
							</tr>
							-->
						</table>
						<div class="modal-footer">
                        <input type="hidden" id="productid" name="productid">
							<button type="button" class="btn btn-default"
							        data-dismiss="modal"> 关闭 </button>
							<button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','MergeProductform')"> 提交 </button>
							<!--            <button type="submit" name="spa">保存</button>
							-->          </div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
			</div>
		</div>
	</form>
	<!-- 模态框（Modal）合并商品 -->
</body>
</html>